package com.blds.mc.controller;

import com.blds.mc.util.FtpUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

/**
 * <p>
 * demo
 * </p>
 *
 * @author stwyj
 * @since 2018/5/28
 */
@RestController
public class HelloController {

    @GetMapping("hello")
    public Object sayHello(String name) throws FileNotFoundException {
        File file = new File("D:\\" + name +".png");

        return FtpUtil.uploadFile(file.getName(), new FileInputStream(file));
    }
}
